#pragma once
#include <string>
namespace hwdrv {
class ComPort
{
public:
    enum BaudRate
    {
        BAUDRATE_9600 = 9600,
        BAUDRATE_19200 = 19200,
        BAUDRATE_38400 = 38400,
        BAUDRATE_57600 = 57600,
        BAUDRATE_115200 = 115200
    };
    enum Parity
    {
        PARITY_NONE = 0,
        PARITY_ODD = 1,
        PARITY_EVEN = 2
    };
    enum StopBits
    {
        STOPBITS_1 = 1,
        STOPBITS_2 = 2
    };
    enum DataBits
    {
        DATABITS_5 = 5,
        DATABITS_6 = 6,
        DATABITS_7 = 7,
        DATABITS_8 = 8
    };
    enum ComType
    {
        ComType_UNKNOWN = 0,
        ComType_RS485,
        ComType_RS422
    };

    ComPort() {}
    int read_from_os() { return -1; }
    int config(uint32_t baudrate, uint8_t parity, uint8_t datebit, uint8_t stopbit) { return -1; }

    std::string dev_name;
    std::string adapter_;
    ComType hw_type_;
    BaudRate baudrate_;
    Parity parity_;
    DataBits databits_;
    StopBits stopbits_;
};
}  // namespace hwdrv
